﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

/********
 * 业务逻辑子类继承后,必须实现 X_BaseEntity Get
 * 
*/
namespace CXJ.BLL
{
    public class BaseBLL
    {
        
        private Interface.IDataOperater _DataOperater;
        private Interface.IBaseEntity _BaseEntity;

        public Interface.IDataOperater X_DataOperater
        {
            get
            {
                if (_DataOperater == null && X_BaseEntity != null)
                {
                    InitDataOperater();
                }
                return _DataOperater;
            }
            set { _DataOperater = value; }
        }

        public virtual Interface.IBaseEntity X_BaseEntity
        {
            get { return _BaseEntity; }
            set { _BaseEntity = value; }
        }

        private void InitDataOperater()
        {
            X_DataOperater = CXJ.Libiary.DataFactory.Create(X_BaseEntity.GetType());
        }
    }
}
